﻿using System.Web.UI;

namespace Sex
{
    public partial class Sex : System.Web.UI.Page
    {
        public class ListTemplates : MyList
        {
            public ListTemplates(State MyState)
                : base(MyState, "Media Templates" + GetHtmlJsHighlightReduced(MyState, "xml"), "Id", new string[] { "Name", "IMAGE", "AUDIO", "VIDEO", "TEMPLATE" })
            {
                for (int i = 0; i < MediaTemplates.list.Count; i++)
                {
                    Add(MediaTemplates.list[i].Id.ToString().PadLeft(2,'0'), new string[] 
                    { 
                        MediaTemplates.list[i].Name,
                        MediaTemplates.list[i].UseWithImage.ToString(),
                        MediaTemplates.list[i].UseWithAudio.ToString(),
                        MediaTemplates.list[i].UseWithVideo.ToString(),
                        GetHighlightCode(MediaTemplates.list[i].InstantiateTemplate("320", "200", "file.ext"), "xml")
                    });
                }
            }
        }
    }
}